<% include ../header.ejs %>

<link rel="stylesheet" href="/stylesheets/app/schedule/schedule_index.css" />

<header data-am-widget="header" data-am-sticky class="am-header am-header-default" id="appTemplates-Nav">
    <div class="am-header-left am-header-nav">
        <a href='/smtool_project/wxapp' class="">
            <img class="am-header-icon-custom" src="data:image/svg+xml;charset&#x3D;utf-8,&lt;svg xmlns&#x3D;&quot;http://www.w3.org/2000/svg&quot; viewBox&#x3D;&quot;0 0 12 20&quot;&gt;&lt;path d&#x3D;&quot;M10,0l2,2l-8,8l8,8l-2,2L0,10L10,0z&quot; fill&#x3D;&quot;%23fff&quot;/&gt;&lt;/svg&gt;" alt=""/>
        </a>
    </div>

    <h1 class="am-header-title">
        <a href="#title-link" class="" id="Typeface-whitecolor">我的日程</a>
    </h1>

    <div class="am-header-right am-header-nav">
        <a href="#" class="" data-am-modal="{target: '#modal-type-add', closeViaDimmer: 0, width: 240}">
            <i class="am-header-icon am-icon-plus"></i>
        </a>
    </div>
</header>

<div ng-app="scheduleList" ng-controller="listController">
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="modal-type-add">
        <div class="am-modal-dialog">
            <div class="am-modal-hd">选择新建日程的类型
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd">
                <a href="survey/add"><button class="am-btn am-btn-primary" style="width:80%;margin:15px auto;">调研</button></a>
                <a href="roadshow/add"><button class="am-btn am-btn-primary" style="width:80%;margin:15px auto;">路演</button></a>
                <a href="strategy/add"><button class="am-btn am-btn-primary" style="width:80%;margin:15px auto;">策略会</button></a>
                <a href="teleconference/add"><button class="am-btn am-btn-primary" style="width:80%;margin:15px auto;">电话会议</button></a>
            </div>
        </div>
    </div>

    <div class="am-g">
        <div class="am-u-sm-2">
            &nbsp;
        </div>
        <div class="am-u-sm-8">
            <div style="margin: auto;width:188px;">
                <div id="schedule_type_switch" class="am-btn-group" data-am-button>
                    <label class="am-btn am-btn-secondary am-btn-sm" ng-click="scheduleType='survey';scheduleDesc='调研';queryList()">
                        <input type="radio" name="schedule_type" value="survey" id="btn_survey" checked needsclick>调研</input>
                    </label>
                    <label class="am-btn am-btn-secondary am-btn-sm" ng-click="scheduleType='roadshow';scheduleDesc='路演';queryList()">
                        <input type="radio" name="schedule_type" value="roadshow" id="btn_roadshow" needsclick>路演</input>
                    </label>
                    <label class="am-btn am-btn-secondary am-btn-sm" ng-click="scheduleType='strategy';scheduleDesc='策略会';queryList()">
                        <input type="radio" name="schedule_type" value="strategy" id="btn_strategy" needsclick>策略会</input>
                    </label>
                </div>
            </div>
        </div>
        <div class="am-u-sm-2">
            <button id="filter-toggle" type="button" class="am-btn am-btn-sm" data-am-button style="margin-top:5px;margin-right:5px">
                <i class="am-icon-filter"></i>
            </button>
        </div>
    </div>

    <div id="schedule_filter" style="width:100%;display:none;">
        <div class="am-g" style="margin-top:5px;">
            <div class="am-u-sm-3">
                &nbsp;
            </div>
            <div class="am-u-sm-6">
                <div style="margin:auto;width:117px;">
                    <div class="am-btn-group" data-am-button>
                        <label class="am-btn am-btn-secondary am-btn-sm" ng-click="schedulePeople='team';queryList()">
                            <input type="radio" name="people_type" value="team" id="team" checked needsclick>群组</input>
                        </label>
                        <label class="am-btn am-btn-secondary am-btn-sm" ng-click="schedulePeople='personal';queryList()">
                            <input type="radio" name="people_type" value="personal" id="personal" needsclick>个人</input>
                        </label>
                    </div>
                </div>
            </div>
            <div class="am-u-sm-3">
                <div id="personal_select_container" style="margin-right:5px;display:none;">
                    <select id="personal_select" data-am-selected="{btnWidth: '70px', maxHeight: 150, btnSize: 'sm'}">
                        <% users.forEach(function (data, index) {%>
                            <option value="<%=data.rowId%>" <%if(index==0){%>selected<%}%>><%=data.name%></option>
                        <% })%>
                    </select>
                </div>
            </div>
        </div>

        <div id="toggle_time" style="margin:5px auto;width:260px;">
            <div class="am-btn-group" data-am-button>
                <label class="am-btn am-btn-secondary am-btn-sm" ng-click="changeDate('all')">
                    <input type="radio" name="time_type" value="all" id="all" checked needsclick>全部</input>
                </label>
                <label class="am-btn am-btn-secondary am-btn-sm" ng-click="changeDate('week')">
                    <input type="radio" name="time_type" value="week" id="week" needsclick>近一周</input>
                </label>
                <label class="am-btn am-btn-secondary am-btn-sm" ng-click="changeDate('month')">
                    <input type="radio" name="time_type" value="month" id="month" needsclick>近一月</input>
                </label>
                <label class="am-btn am-btn-secondary am-btn-sm">
                    <input type="radio" name="time_type" value="day" id="day" needsclick>指定</input>
                </label>
            </div>
        </div>
    </div>

    <div data-am-widget="list_news" class="am-list-news am-list-news-default" >
        <div class="am-list-news-bd">
            <ul class="am-list" ng-cloak>
                    <a class="am-list-main" href="{{scheduleType}}/detail?rowId={{data.rowId}}">
                        <div class="am-g">
                            <div class="am-u-sm-9">
                                <h5 class="am-list-item-hd">{{data.seller.name}}</h5>
                            </div>
                            <div class="am-u-sm-3" style="text-align:right;">
                                <span class="am-badge am-badge-success am-radius am-text-sm">{{data.type}}</span>
                            </div>
                        </div>
                        <div class="am-g">
                            <div class="am-u-sm-12">
                                <h6 class="am-list-item-text">{{data.content}}</h6>
                            </div>
                        </div>
                        <div class="am-g">
                            <div class="am-u-sm-4">
                                <h6 class="am-list-item-text" style="color: #9b9b9b;">{{data.createUid.name}}</h6>
                            </div>
                            <div class="am-u-sm-8" style="text-align:right;">
                                <h6 class="am-list-item-text" style="color: #9b9b9b;">{{data.startTime}}&nbsp;{{data.finishTime}}</h6>
                            </div>
                        </div>
                    </a>
                </li>
            </ul>
        </div>
    </div>

</div>
<script src="/javascripts/app/schedule/schedule_index.js"></script>

<% include ../footer.ejs %>
